﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EEM.Helpers
{
    public static class StringHelper
    {
        /// <summary>
        /// 将字符串转换成int
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static int GetInt(this string str) 
        {
            int.TryParse(str, out int result);
            return result;
        }

        /// <summary>
        /// 将字符串转换成byte
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static byte GetByte(this string str) 
        { 
            byte.TryParse(str, out byte result);
            return result;
        }
    }
}
